﻿Imports System.Object
Imports VSModel
Imports Cls_Common

Partial Class FrontEnd_Control_Home_PromotionTop3
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Using _data As New VSEntities
                Dim p = (From q In _data.ImagesAdvers Where q.StatusID = 3 And q.Subject = ImageAdverType.TichDiem And q.LanguageID = 1 Select q Order By q.Sort).FirstOrDefault
                If Not p Is Nothing Then
                    hplTitle.NavigateUrl = p.URL
                    imgTichDiem.ImageUrl = p.SRC
                    imgTichDiem.ToolTip = p.Title
                End If


            End Using
        End If
    End Sub

    'Protected Sub rptShow_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptShow.ItemDataBound
    'Dim row = CType(e.Item.DataItem, Object)
    'Dim img As Image = CType(e.Item.FindControl("imgPreview"), Image)
    'Dim hplTitle As HyperLink = CType(e.Item.FindControl("hplTitle"), HyperLink)
    'Dim ltrTitle As Literal = CType(e.Item.FindControl("ltrTitle"), Literal)


    'img.ImageUrl = CookedImageURL("212-180", row.ImagePreview)
    'img.AlternateText = row.Title
    'img.Style.Add("overflow", "hidden")

    'ltrTitle.Text = row.Title
    ''  hplImg.NavigateUrl = MainDomain & row.CateQuerystring & "-" & row.CateID & "/" & row.QueryString & "-" & row.ProductId.ToString & "/chi-tiet.html"
    'hplTitle.NavigateUrl = MainDomain & row.QueryString & "-" & row.ProductId.ToString & ".html"

    ''ltrPrice.Text = Format_Currency(row.OriginalPrice.ToString())
    ''ltrPriceSaleOff.Text = Format_Currency(row.SellPrice.ToString())
    ''ltrSaleOff.Text = Format_Currency(((row.OriginalPrice - row.SellPrice) * 100 / row.OriginalPrice).ToString())

    ' End Sub
End Class
